-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigator - Guard against a goTo to the current screen #1331
Conversation
backStack.push(screen) | ||
override fun goTo(screen: Screen): Boolean { | ||
return if (peek() != screen) { | ||
backStack.push(screen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mirror this in the back stack push()? I actually wonder if this would be better off as a back stack configuration
override fun goTo(screen: Screen): Boolean { | ||
val res = delegate.goTo(screen) | ||
if (res) { | ||
goToEvents.add(screen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of me thinks this should always log but we could offer a way to read the transaction result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a GoToEvent
to cover this 👍🏻
Implements #1317 with the bool result return approach. Open to also going with the passed in callback which was another suggested approach.